<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="font/iconfont.css">
    <link rel="stylesheet" href="css/swiper.min.css">
    <link rel="stylesheet" href="css/site.css">
    <script src="js/viewport.js"></script>
    <script src="js/swiper.min.js"></script>
    <script src="js/jquery-1.8.3.js"></script>
    <script src="js/public.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/axios.js"></script>
    <script src="js/qs.js"></script>
</head>

<body>
<div id="app">
    <header class="padding-35">
        <div class="logo">
            <img src="imgs/logo.png" alt="">
        </div>
        <div class="menu">
            <img src="imgs/menu.png" alt="">
        </div>
    </header>
    <div class="mbx padding-35">
        <a href="index.html">健康美食网</a>
        <i class="iconfont icon-arrow-right-copy-copy"></i>
        <span>全部菜谱</span>
    </div>
    <div class="detailBanner">
        <img :src="category.cimg" alt="">
    </div>
    <div class="detailCon padding-35">
        <div class="detailItem">
            <div class="detailItemTit">{{category.cname}}</div>
            <div class="detailItemAuto">作者：巧妇</div>
            <div class="detailItemCon">
                <p>简介</p>
                <p>
                    {{category.cintroduce}}
                </p>
            </div>
            <div class="mianLiao">营养功效</div>
            <div class="mianLiaoBox">
                {{category.cnutrition}}
            </div>
            <div class="mianLiao">做法</div>
                {{category.cmake}}
            <div class="mianLiaoBox">
            </div>
    <footer>
        <p>版权所有：版权所有：健康美食网 WWW.JKMEISHI.COM</p>
        <p>Copyright 2011-2018 备案号:鄂ICP备11013833号-4</p>
    </footer>
</div>
<script>
    var url = decodeURI(window.location.href);
    console.log(url);
    // var backToPreUrl = url.split("?");
    // console.log(backToPreUrl);
    // console.log(backToPreUrl[1]);

    var backToPreUrl = url.split("=");
    var id = backToPreUrl[1];
    console.log(id)
    var v = new Vue({
        el : "#app",
        data : {
            cid : "",
            category : {}
        },
        created(){
            this.queryByid();
        },
        methods:{
            queryByid(){
                this.cid=id;
                console.log(this.cid);
                axios.post("healthy/category/querybyCid",qs.stringify({id : this.cid})).then(res=>{
                    this.category = res.data.data;
                    console.log(this.category);
                })
            }
        }
    })
</script>

</body>

</html>